package fr.labri.macchiato.feature.localRepositoryJson;

import java.util.List;

import fr.labri.macchiato.core.model.UserPreferences;
import fr.labri.macchiato.core.technical.Encoder;

/**
 * Repository for the {@link UserPreferences} class
 * 
 * @author Matthieu FOUCAULT
 * 
 */
public class PreferencesRepository extends StorageRepository<UserPreferences, String> {

	/**
	 * Creates a new {@link PreferencesRepository}, that can use whether HTML5
	 * local or session storage
	 * 
	 * @param useLocalStorage
	 */
	public PreferencesRepository(boolean useLocalStorage) {
		super(useLocalStorage);
	}

	private static final String KEY = "user_preferences";

	@Override
	protected String getKeyPrefix() {
		return KEY;
	}

	@Override
	protected Encoder<List<String>> getIdsEncoder() {
		return new StringListEncoder();
	}

	@Override
	protected String getEncodedEntity(UserPreferences entity) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected UserPreferences getDecodedEntity(String string) {
		// TODO Auto-generated method stub
		return null;
	}

}
